
var successUpdateCallback = function (data) {
    //清空原来数据
    $("#hotelBody").html('');
    var hotels = data.data;
    for (var i = 0; i < hotels.length; i++) {
        var html = '<tr>';
        html += '<td><input type="hidden" value="' + hotels[i].id + '" />' + hotels[i].id + '</td>';
        html += '<td>' + hotels[i].name + '</td>';
        html += '<td>' + hotels[i].cityname + '</td>';
        html += '<td>' + hotels[i].areaname + '</td>';
        html += '<td>' + hotels[i].enddate + '</td>';
        html += '</tr>';
        $("#hotelBody").append(html);
    }
};
var errorUpdateCallback = function (data) {
    if (typeof (data.responseJSON) == "undefined") {
        tooltipWrong($('#requestConfuse'), '系统内部错误', 3);
    } else {
        tip = data.responseJSON.info;
        tooltipWrong($('#requestConfuse'), tip, 3);
    }
};




$(function () {
    $('.confuse').on('click', function (e) {
        e.preventDefault();
        var obj = JSON.parse($(this).attr("data-json"));
        var id = obj.id;
        $("#requestConfuse").attr('data-value', id);
    });
    $(".view").on('click', function (e) {
        e.preventDefault();
        var obj = JSON.parse(($(this).attr("data-json")));
        var params = new Object();
        params.userId = obj.adminlogin_id;
        ajaxRequest('/Home/Account/getHotel', params, 'post', successUpdateCallback, errorUpdateCallback);
    });
});

